package com.ruoyi.report.service.Impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.report.domain.ReportShareToken;
import com.ruoyi.report.mapper.ReportShareTokenMapper;
import com.ruoyi.report.service.IReportShareTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 报分享日志Service业务层处理
 *
 * @author ruoyi
 * @date 2022-03-22
 */
@Service
public class ReportShareTokenServiceImpl implements IReportShareTokenService
{
    @Autowired
    private ReportShareTokenMapper reportShareTokenMapper;

    /**
     * 查询报分享日志
     *
     * @param id 报分享日志主键
     * @return 报分享日志
     */
    @Override
    public ReportShareToken selectReportShareTokenById(String id)
    {
        return reportShareTokenMapper.selectReportShareTokenById(id);
    }

    /**
     * 查询报分享日志列表
     *
     * @param reportShareToken 报分享日志
     * @return 报分享日志
     */
    @Override
    public List<ReportShareToken> selectReportShareTokenList(ReportShareToken reportShareToken)
    {
        return reportShareTokenMapper.selectReportShareTokenList(reportShareToken);
    }

    /**
     * 新增报分享日志
     *
     * @param reportShareToken 报分享日志
     * @return 结果
     */
    @Override
    public int insertReportShareToken(ReportShareToken reportShareToken)
    {
        reportShareToken.setCreateTime(DateUtils.getNowDate());
        return reportShareTokenMapper.insertReportShareToken(reportShareToken);
    }

    /**
     * 修改报分享日志
     *
     * @param reportShareToken 报分享日志
     * @return 结果
     */
    @Override
    public int updateReportShareToken(ReportShareToken reportShareToken)
    {
        reportShareToken.setUpdateTime(DateUtils.getNowDate());
        return reportShareTokenMapper.updateReportShareToken(reportShareToken);
    }

    /**
     * 批量删除报分享日志
     *
     * @param ids 需要删除的报分享日志主键
     * @return 结果
     */
    @Override
    public int deleteReportShareTokenByIds(String[] ids)
    {
        return reportShareTokenMapper.deleteReportShareTokenByIds(ids);
    }

    /**
     * 删除报分享日志信息
     *
     * @param id 报分享日志主键
     * @return 结果
     */
    @Override
    public int deleteReportShareTokenById(String id)
    {
        return reportShareTokenMapper.deleteReportShareTokenById(id);
    }
}
